package com.hyl.gulimall.alipaydemo.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000120606625";

	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCPLzCmHTE60xz+AYhQhCkhbidnl8JGdzx294idjriqUeuSrk4kBuStK2sqiBQ0htXcR06OGYhdE+GHSPfHwz2I+UHAbOPUnAI2OpZ5s26gVS2jnXrO0hxIqNaHFc3hhzGH7V3GNLkuMTaqesGcfVK/rxTklQSJEH89Ww6Luq7Au44wOqsHVTwUwRoqPl5qJz1sSuxsp2BCVBF8WUoQBaFz6giWKyAdcUI7ycumcuEHdSMn7d9CPkAvaLTbeMnryW/UqHscVgHAlpOGj4pF3cbzaNwElq3yvVIz6RVio7IlIwLeu9NfJbhGrXF1OGOp8k485IW9gYT8HHrMLcR9mKajAgMBAAECggEAEUQwiqeUizJwGZVXudXmG9jruYtMazDvwqzg9ZcDX86XKM4KMEAAjX1h4/Qa86aa3YBf0bT0g7zlAmpjLty1a/Ia4rh+1OGnRqDUCoL/wSfkZAmWiKA/tuddT1bqx9qEt46BM2iiOBbJL8+zz0oxk1nqnBH4RQsPPPfhDiqJ7kW/t38d7CeX2HNlEmY/AtnaTP4dCk9ZwomStyZ0hHA3Se1Y4q3bi+LrAawAExLuEoIeOk3BEg6cGMJLbuFjfxNZPcsVrlRujOy4HOZuIbCr5kuXj0XWdjahUFgOiuBu7wAIRyBGOfzuNT7EPgpyLppZO7emKG8R7llvGa4EnbbSKQKBgQD+XspvScvbFYTn3fH8vpOgXlhAb2uJTBYV5wqpxkqJIymsb5Bhe20XxEXVDuj8xqqtHc2jm62ppD7bfYsHNNq8zOoP4zAMvmIxp3WSUJL8siUjU/vImqEUTX6GAirNjkrBHuH9gMAewVO5tfvSdpvMdFepQKqIKcbpKUiTSAvH5wKBgQCQGgk19zYhJkK5DwA+x7KsWU/+i2zhTH5GMVZpQZOVq7jZ1XgLccS2QUHj5h+S5pIjfTfNhXhBkME22MSTwy6RTgaKyvHGtTLC7rrD5ivNsIzWK/GesaQUeHaU2nbTcH4p3u4aFFNje+zMKSN868wprEZxhilZviyT1dhjMyvj5QKBgG7tn5JQuFneVItZOsJhybdR7WKMNHU3fRooG3pWQwLzFqVgMbKRRM3shheX3Pr/GEdOi/MhXOZx/gdyBEMsRYe4RQqQpM+p5uCIirk38iHI/nEdmtusszpLYTXHlCr4Nplpglwu3ZmL7Zs7RYpOtzq+McxZqwSeU2Qy4Ld538lZAoGAeQDj6yUDlyKBtNQb6JvYNVFqEt0ROL766gZUAV7Hh08Dkifm/fUysbhqk+yRZtGmtZZYXYROTwA2vs+XglzLpchXRgTUsX9GeNnuisGk1rwCB3YvFosktOvS53vre/Fif9ZrKgsXWtqdJXMGEcgPUI8ROBLoditzU1Cmu+YkXOECgYA7vzSkyVOBqT1LQn9a0wYSzv23GPcIXyBAra0PWPd645E6ju6BfV85q9OsPQVy8CyN5AHbesd6MPa7gNvT2JeM1+UuuKqUAec27YxCwJKNpvD0MJR1kG3u1j/Q4p7Xw7Ql3y6GuWbpSm/eJ1MjusRp3zTUch9K9zR8UP7xMmy56w==";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmpkTkI6G+3bPlrxGOx/PZPnPE1BVNAFag+bCFj4W0BcuA2hPXuXB4zg07XlKRSYgI7M06ZjqSjcaDlpHBqWBWd/6BgKku2gilqREoT9SHU/De1wSj2QzOcklPTIcWAEIVpFDvhQpqBamWoZBvdtubPu016xw9vN0mQ38o4a6fhsoKIA+1Rjugkj3Q3BaLsinnhzk1xb6ozhAOqBPNJ+KKJBqlE2WTlfXohkwa1txNAra5Wyl7X9O20QQfVYQkow4zGHeaqQt4uxf2awN65S/gY+H6CbhAps7M0yrP1v3Bd4nRCQpIFnNaWRHS6L3meO5ZKFuFBe9wsn3cTh3KOa3MQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:4000/notify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:4000/return";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

